package com.neusoft.databus.common.dto;

import java.util.ArrayList;
import java.util.List;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.dto.AbstractAuditDTO;
import com.neusoft.databus.common.enums.MetricUsageType;
import com.neusoft.databus.common.enums.Protocol;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * 指标组DTO
 *
 * @author sunchf
 * @date 2018年12月21日 下午4:33:16
 */
@Getter
@Setter
@ToString
public class MetricGroupDTO extends AbstractAuditDTO {

    private static final long serialVersionUID = -2663616119705390735L;

    /** 指标组编码 */
    @ApiModelProperty(value = "指标组编码", required = false, position = 1)
    private String code;

    /** 指标组名称 */
    @ApiModelProperty(value = "指标组名称", required = true, position = 2)
    @NotBlank(message = "指标组名称不能为空")
    @Length(max = 255, message = "指标组名称不能超过{max}位")
    private String name;

    /** 指标组协议 */
    @ApiModelProperty(value = "指标组协议", required = true, position = 3)
    @NotNull(message = "指标组协议不能为空")
    private Protocol protocol;

    /** 扩展配置 */
    @ApiModelProperty(value = "扩展配置", required = false, position = 4)
    private String config;

    //    /** 采集周期 */
    //    @ApiModelProperty(value = "采集周期", required = true, position = 5)
    //    @NotNull(message = "采集周期不能为空")
    //    @Min(value = 1, message = "采集周期不能小于{value}秒")
    //    private Long executionCycle;

    /** 指标组用途 */
    @ApiModelProperty(value = "指标组用途", required = false, position = 6)
    private MetricUsageType usageType = MetricUsageType.COLLECT;

    /** 关联指标数量(列表查询时, 只显示指标数量) */
    @ApiModelProperty(value = "关联指标数量", required = false, position = 7)
    private int metricSize = 0;

    /** 关联指标 */
    @ApiModelProperty(value = "关联指标", required = false, position = 8)
    private List<MetricDTO> metrics = new ArrayList<>();

    /** 注释 */
    @ApiModelProperty(value = "注释", required = false, position = 9)
    private String comment;

}
